<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Administrator extends MY_Administrator {
	function __construct() 
	{
		parent::__construct();
	}
	
	public function index()
	{
		redirect($this->data['admin_path'].'user/user_profile');
	}
	
	public function login()
	{
		/*POST*/
		if(isset($_POST['user_login'])):
			$this->administrator_model->login();			
		endif;
		
		/*Load Content*/
		$this->data['dataResult'] = $this->load->view($this->data['admin_path'].$this->router->method,$this->data,true);
		
		/*Load Templates*/
		$this->load->view($this->data['admin_path'].'templates/templates_login',$this->data);
	}
	
	public function forget()
	{
		/*POST*/
		if(isset($_POST['user_login'])):
			$this->administrator_model->forget();
		endif;
				
		/*Load Content*/
		$this->data['dataResult'] = $this->load->view($this->data['admin_path'].$this->router->method,$this->data,true);
		
		/*Load Templates*/
		$this->load->view($this->data['admin_path'].'templates/templates_login',$this->data);		
	}	
	
	public function logout()
	{
		$this->administrator_model->logout();		
	}
}

/* End of file admin.php */
/* Location: ./application/controllers/admin.php */